# https://gitee.com/chen2ha/dockerfile
## base-image-alpine
FROM baseimage:alpine3.20

COPY nfsd.sh /usr/bin/nfsd

RUN apk --no-cache --update --verbose --progress add \
        nfs-utils \
        iproute2 \
    && rm -rf /var/cache/apk /tmp /sbin/halt /sbin/poweroff /sbin/reboot \
    && mkdir -p /var/lib/nfs/rpc_pipefs /var/lib/nfs/v4recovery \
    && echo "rpc_pipefs   /var/lib/nfs/rpc_pipefs   rpc_pipefs   defaults 0 0" >> /etc/fstab \
    && echo "nfsd         /proc/fs/nfsd             nfsd         defaults 0 0" >> /etc/fstab \
    && chmod +x /usr/bin/nfsd

ENTRYPOINT ["/usr/bin/nfsd"]
